package com.niit.web.controller;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.niit.bean.Blog;
import com.niit.service.BlogService;
import com.niit.service.impl.BlogServiceImpl;

@WebServlet("/ShowBlogContentControllor")
public class ShowBlogContentControllor extends HttpServlet {
	private static final long serialVersionUID = 1L;
 
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		doPost(request, response);
	}


	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		String blogId = request.getParameter("blogId");
		BlogService bs = new BlogServiceImpl();
		Blog blog = bs.findByBlogId(blogId);
		request.setAttribute("blog", blog);
		request.getRequestDispatcher("/jsp/admin/load/them2detail.jsp").forward(request, response);

	}

}
